<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="css/style.css">
	<script src="laydate/laydate.js"></script>
	<script src="jquery-1.7.2.min.js"></script>
	<style>
		body{width: 1200px;margin:0 auto;font-family: "Simsun",Tahoma,Arial,sans-serif;font-size: 14px;color:#000;}
		.mydetail{width: 1200px;padding-bottom:50px }
		table {background-color: transparent;border-collapse: collapse;border-spacing: 0;}
		.mydetail th, .mydetail td {border: 1px solid #e2e2e2;}
		.mydetail td,.mydetail th {text-align: center;padding: 10px 5px;}
		.tal{text-align: left;}
		.tac{text-align: center;}
		.search-con{height: 50px;line-height: 50px;background:#f3f3f3;padding: 5px 30px;margin-bottom: 10px}
		.search-con input{margin-right: 30px;}
		.search-con span{color: red;font-weight: bold;}
	.STYLE2 {font-size: medium}
    a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<?php 

	header("Content-Type:text/html;charset=utf-8");
	include 'includes/init.php';
	session_start();
	$id=isset($_SESSION['id'])?$_SESSION['id']:'';
	$time = time();

	if($_GET['type'] == 'admin'){
		$sql = "SELECT DISTINCT
			project
		FROM
			t_examine
		WHERE
			mid = '".$id."'
		;";

		$project = $db_Obj ->getall($sql);
		// 项目筛选
		if(!empty($_POST['project'])){
			$pro = empty($_POST['project']) ? '' : $_POST['project'];
				$sql = "SELECT 
					e.*, m.`names`
				FROM
					t_examine AS e,
					t_member AS m
				WHERE
					e.mid = '".$id."'
					AND
					e.`project` = '".$pro."'
					AND 
					e.`mid` = m.id
					";
			$infoAll = $db_Obj->getall($sql);
		}
	}

	if($_GET['type'] == 'lead' || $_SESSION['rule_id'] == 5){
		$sql = "SELECT DISTINCT
			project
		FROM
			t_examine;";

		$project = $db_Obj ->getall($sql);

		// 项目筛选
		if(!empty($_POST['project'])){
			$pro = empty($_POST['project']) ? '' : $_POST['project'];
				$sql = "SELECT
					e.*, m.`names`
				FROM
					t_examine AS e,
					t_member AS m
				WHERE
					e.project = '".$pro."'
				AND e.mid = m.id";

			$infoAll = $db_Obj->getall($sql);
		}
	}
	


 ?>
<body>
	<table width="1500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="100"><a href="http://www.ego-buy.com.cn/"><img src="image/bg11.jpg" alt="0" width="1200" height="76" border="0"></a></td>
      </tr>
      <tr>
        <td height="50"><img src="image/bg14.jpg" alt="0" width="1200" height="87"></td>
      </tr>
      <tr>
        <td height="50"><a href="index.php" class="STYLE2" style="margin-left:10px;">返回列表</a></td>
      </tr>
    </table>
	<div class="search-con">
		<form  method="post">
			<span>项目名称:</span>
			<select name="project" id="" style="width: 150px;height: 25px">
				<option value="">请选择</option>
			<?php foreach ($project as $key=>$value) {   ?>
				<option value="<?php echo $value['project']; ?>"><?php echo $value['project']; ?></option>
			<?php } ?>
			</select>
			<input type="submit" value="查询">
		</form>
	</div>
	<div class="mydetail">
		<table class="table_02">
			<tbody>
			<tr>
				<th class="titleA">项目名称</th>
				<th class="titleA">商品型号</th>
				<th class="titleA">商品规格</th>
				<th class="titleA">计量单位</th>
				<th class="titleA">商品数量</th>
				<th class="titleA">币种</th>
				<th class="titleA">询价类型</th>
				<th class="titleA">附件</th>
				<th class="titleA">备注</th>
				<th class="titleA">物料组</th>
				<th class="titleA">采购组</th>
				<th class="titleA">工厂组</th>
				<th class="titleA">配额</th>
				<th class="titleA">竞价状态</th>
				<th class="titleA">密封状态</th>
				<th class="titleA" width="100px">截至日期</th>
				<th class="titleA">供应商</th>
			</tr>
			<?php if(!empty($infoAll)){  ?>
				<?php foreach ($infoAll as $key=>$value) {   ?>
				<tr>
					<td><?php echo $value['project']; ?></td>
					<td><?php echo $value['btype']; ?></td>
					<td><?php echo $value['bsize']; ?></td>
					<td><?php echo $value['units']; ?></td>
					<td><?php echo $value['bnumber']; ?></td>
					<td><?php echo $value['currency']; ?></td>
					<td><?php echo $value['price_type']; ?></td>
					<td><a href="./upload/<?php echo $value['file_name']; ?>" class="STYLE3" download="./upload/<?php echo $value['file_name']; ?>"><?php echo $value['file_name']; ?></a></td>
					<td><?php echo $value['note']; ?></td>
					<td><?php echo $value['material']; ?></td>
					<td><?php echo $value['purchase']; ?></td>
					<td><?php echo $value['plant']; ?></td>
					<td><?php echo $value['extranum']; ?></td>
					<td><?php if($value['status'] == 1){ echo "竞价"; }else if($value['status'] == 0){ echo "非竞价"; } ?></td>
					<td><?php if($value['price_type'] == 1){ echo "密封"; }else if($value['price_type'] == 0){ echo "非密封"; } ?></td>
					<td><?php echo date('Y-m-d H:i:s',$value['lasttime']); ?></td>
					<td><?php echo $value['names']; ?></td>
				</tr>
				<?php } ?>
			<?php }else{ ?>
				<tr>
					<td colspan="19">
						<span>占无数据</span>
					</td>
				</tr>
			<?php } ?>
			</tbody>
		</table>		
	</div>
	<form action="" method='post'>
	<div style="text-align: right;margin-top: 50px">
		<input type="hidden" name="project" value="<?php if(isset($_POST['project'])){echo $_POST['project']; }  ?>">
		<button type="submit" id="export" name="export" value="1">导出excel</button>
	</div>
	</form>
		        <table width="1200" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="100" align="center" valign="bottom"><p><span class="STYLE8 STYLE3"><a rel="nofollow" target="_blank" href="http://www.ego-buy.com.cn/faqListDetail.do?parent_id=108&id=112">集团简介 | </a><a rel="nofollow" target="_blank" href="http://www.ego-buy.com.cn/faqListDetail.do?parent_id=108&id=143">广告服务</a> | <a rel="nofollow" target="_blank" href="http://www.ego-buy.com.cn/faqListDetail.do?parent_id=108&id=115">版权信息 |</a> <a rel="nofollow" target="_blank" href="http://www.ego-buy.com.cn/faqListDetail.do?parent_id=108&id=113">商家入驻 </a> | <a rel="nofollow" target="_blank" href="http://www.ego-buy.com.cn/faqListDetail.do?parent_id=108&id=114">新闻动态</a></span></p></td>
          </tr>
          <tr>
            <td height="30" align="center"><span class="STYLE3">Copyright © 2014-2015 ego-buy.com.cn All Rights Reserved 粤ICP备15026826号</span></td>
          </tr>
        </table>
</body>
</html>